 // pages/photo/photo.js
Page({
  data: {
    index: '',
    id: '',
    data: ''
  },
  onLoad(options){
    let that = this;
    that.setData({
      index: options.id
    })
    wx.request({
      url: 'https://cnodejs.org/api/v1/topics/',
      method: 'GET',
      dataType: 'json',
      responseType: 'text',
      success: function (res) {
        that.setData({
          id: res.data.data[that.data.index].author.loginname,
        })
        wx.request({
          url: 'https://cnodejs.org/api/v1/user/' + that.data.id,
          data:{
            accesstoken:"de4b3a69-1af4-47ee-aed9-cd7a43c2f0e5"
          },
          method: 'GET',
          dataType: 'json',
          responseType: 'text',
          success: function (res) {
            that.setData({
               data: res.data.data
            })
            console.log(res.data.data)
          }
        })
      },
      fail: function (res) {
      },
      complete: function (res) {
      }
    })
  }
})